<!--{template admin/header}-->
<body id="homepage">
    <div id="breadcrumb">
        <ul>
            <li><img src="static/img/icons/icon_breadcrumb.png" alt="Location" /></li>
            <li><strong>位置:</strong></li>
            <li><a href="admin.php">主页</a> - 表情打包</li>
        </ul>
    
    </div>
    	<!--{template admin/leftside}-->
	<div id="rightside" class="user_ability">
	
		<div class="contentcontainer">
			<div class="headings altheading">
				<h3>
					表情打包
				</h3>
			</div>
			<h4>步骤一：打包。</h4>
			<form  class="form-inline" role="form" method="post" action='admin.php?ac=pack_emotion&op=submit' enctype="multipart/form-data">
				<input type="hidden" name='id' value={$newEmotionId} >
			    <div class="form-group">
			      <label for="name">表情包拼音名称</label>
			      <input type="text" class="form-control" name="name"
			         placeholder="请输入名称拼音"><strong>例子：ouxianglaile</strong>
			   </div>
			   <div class="form-group">
			      <label for="inputfile">文件输入</label>
			      <input type="file" id="inputfile" name="package">
			      <strong>例子：偶像来了.zip(注意：压缩前的文件夹名字也是<i>偶像来了</i> )</strong>
			   </div>
			   <button type="submit" class="btn btn-default"
			   	{if $content}
			   		disabled
			  	 {/if}
			   >提交</button>
			</form>
			<hr/>
			{if $content}
				<div class="alert">
  					<button type="button" class="close" data-dismiss="alert">&times;</button>
 					 <strong>警告</strong> 有一个包文件还没有发布，请填写必要信息后发布.
				</div>
			{/if}
			<h4>步骤二：发布</h4>
				<form id='shop'>
						
								<div class="input-prepend">
									<span class="add-on">id号</span>
									<input class="span4" id="prependedInput" type="text" readonly placeholder="id" name="id" value="{$data['id']}">
								</div>
		
								<div class="input-prepend">
									<span class="add-on">名称</span>
									<input class="span4" id="prependedInput" type="text" readonly placeholder="name" name="name" value="{$data['name']}">
								</div>
								<br/>
								
								<div class="input-prepend">
									<span class="add-on">封面</span>
									<input class="span4" id="prependedInput" type="text" readonly placeholder="封面" name="cover" value="{$data['cover']}">
								</div>
							
								<div class="input-prepend">
									<span class="add-on">推广</span>
									<input class="span4" id="prependedInput" type="text"  placeholder="推广图" name="background">
								</div>
								<br/>
								<div class="input-prepend">
									<span class="add-on">链接</span>
									<input class="span4" id="prependedInput" type="text" readonly placeholder="包地址" name="download_url" value="{$data['download_url']}">
								</div>
							
								<div class="input-prepend">
									<span class="add-on">预览</span>
									<input class="span4" id="prependedInput" type="text" readonly placeholder="预览图" name="thumbnail_m" value="{$data['thumbnail_m']}">
								</div>
								<br/>
								<div class="input-prepend">
									<span class="add-on">小图</span>
									<input class="span4" id="prependedInput" type="text" readonly placeholder="预览小图" name="thumbnail_s" value="{$data['thumbnail_s']}">
								</div>
							
							
								<div class="input-prepend">
									<span class="add-on">分类</span>
									<select name="status" class="span4" >
										<option value="0">上架</option>
										<option value="1">下架</option>
									</select>
								</div>
								<br/>
								<div class="input-prepend">
									<span class="add-on">类别</span>
									<select name="name_tag" class="span4" >
										<option value="0">静图</option>
										<option value="1">动图</option>
									</select>
								</div>
							
								<div class="input-prepend">
									<span class="add-on">标签</span>
									<select name="tag" class="span4" >
										<option value="hot">最热</option>
										<option value="new">最新</option>
									</select>
								</div>
								<br/>
								<div class="input-prepend">
									<span class="add-on">介绍</span>
									<input class="span4" id="prependedInput" type="text" placeholder="介绍" name="desc">
								</div>
						
								<div class="input-prepend">
									<span class="add-on">下载</span>
									<input class="span4" id="prependedInput" type="text" placeholder="下载量" name="sale_amount" value=1>
								</div>
								<br/>
								<div class="input-prepend">
									<span class="add-on">大小</span>
									<input class="span4" id="prependedInput" type="text" placeholder="包大小" name="zip_size" value=1024>
								</div>
								
								<div class="input-prepend">
									<span class="add-on">有效</span>
									<input class="span4" id="prependedInput" type="text" placeholder="有效期" name="expire_time" value=0>
								</div>
								<br/>
								<div class="input-prepend">
									<span class="add-on">原价</span>
									<input class="span4" id="prependedInput" type="text" placeholder="原价(粉币)" name="price_orign">
								</div>
							
								<div class="input-prepend">
									<span class="add-on">促销</span>
									<input class="span4" id="prependedInput" type="text" placeholder="折扣/会员价(粉币)" name="price_final">
								</div>
								<br/>
								<div class="input-prepend">
									<span class="add-on">作者</span>
									<input class="span2" id="prependedInput" type="text" placeholder="作者UID" name="cuid" >
								</div>
								
								<br/>			
									<div class="input-prepend">
									<label >	
									<span class="add-on">下载限制</span>	
										<div class="well">
											<div class="tabbable"> <!-- Only required for left/right tabs -->
											  <ul class="nav nav-tabs">
											  	  <li class="active task_chose"><a href="#tab0" data-toggle="tab">无限制</a></li>
											    <li class="task_chose" name="1"><a href="#tab1" data-toggle="tab">等级</a></li>
											    <li class="task_chose" name="2"><a href="#tab2" data-toggle="tab">达人</a></li>
											    <li class="task_chose" name="3"><a href="#tab3" data-toggle="tab">粉币</a></li>	  		
											  </ul>
											  		<input type="hidden" name="task_type" id="task_type" value=''>
											    <div class="tab-content">
											    	<div class="tab-pane active" id="tab0">
															无
												    </div>
												    <div class="tab-pane " id="tab1">
												
												    </div>
												    <div class="tab-pane" id="tab2">
												
												    </div>
												     <div class="tab-pane" id="tab3">
												
												    </div>
												</div> 	
											  </div>
										</div>
									</label>
									</div>							
								<br/>												 		
								<input type="hidden" name="english_name" value="{$data['english_name']}"/>
						   		<input type="hidden" name="ac" value="shop"/>
						   		<input type="hidden" name="op" value="addEmotion"/>			
							    <button type="button" id="submit" class="btn btn-primary">发布</button>
						  </form>
		</div>
	</div>	
	<script type='text/javascript' src='static/scripts/jquery.min.js'></script>
	<script>
	$(document).on('click','#submit',function(){
		var state ={0:'操作失败',1:'操作成功'};    			
		$.ajax({
				type:'GET',
				url:'shop.php',
				data:$('#shop').serialize(),
					success:function(data){
					
						alert(state[data]);	   
					    window.location.href="admin.php?ac=pack_emotion";												
					}
		});   			
})
	$(document).on('click','.task_chose',function(){
		$("#tab1").html('');
		$("#tab2").html('');
		$("#tab3").html('');
		var id=$(this).attr('name');
		$("#task_type").val(id);
		if(id==1){
			$("#tab1").html('等级数：<input type="text" name="task_num" >说明：<input type="text" name="task_msg" >');			
		}
		if(id==2){			
			$("#tab2").html('达人：<input type="text" name="task_num" >说明：<input type="text" name="task_msg" >');
		}
		if(id==3){
			$("#tab3").html('粉币数：<input type="text" name="task_num" > 说明：<input type="text" name="task_msg" >');
		}
		
		
	})
		


	</script>

    <!--{template admin/footer}-->